{% extends "file_manager/base.html" %}

{% block content %}
<div class="container mt-4">
    <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">视频预览: {{ file_name }} - 提示：在线播放需要视频编码为H.264/AVC格式</h5>
            <a href="{% url 'download' file_path=file_path %}" class="btn btn-sm btn-primary">下载</a>
        </div>
        <div class="card-body">
                {% if file_path and file_path|length > 0 %}
                <video controls style="width: 100%; max-height: 80vh;">
                    <source src="{% url 'download' file_path=file_path %}" type="video/{{ file_path|slice:'-3:'|lower }}">
                    您的浏览器不支持视频播放
                </video>
            {% else %}
                <p class="text-danger">视频路径无效</p>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
